package Tool;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class MySQL_UserDelete {
    public static void userDelete(Connection conn, String id) throws SQLException {
        //定义sql

        //删除

        String sql = "delete from staffsystem.user where ID = ?";
        //获取执行psql的对象  PreparedStatement
        PreparedStatement pstmt = conn.prepareStatement(sql);

        //设置？的值
        pstmt.setString(1, id);

        //执行sql语句
        pstmt.executeUpdate();

        //释放资源
        pstmt.close();
    }
}
